import {get,detele,postJSON,postForm} from '@/utils/http/createHttp.js'
const homeApi = {
    // 首页开始
    getHomeList:(type)=> get(`/api/notice?type=${type}`),
    deleteHome:(id)=> detele(`/api/notice/${id}`),
    addHome:(data)=> postJSON(`/api/notice`, data),

    // 首页结束
    getHomeDetail:(id)=> get(`/api/notice/${id}`),
    // 分类开始
    getClassification:()=> get(`/api/tag`),
    deleteClass:(id)=> detele(`/api/tag/${id}`),
    addClass:(data)=> postJSON(`/api/tag`, data),
    seachClass:(data)=> get(`/api/tag?label=${data}`, ),

    //用户开始
    getAllusers:()=> get(`/api/all/users`),
    deleteUser:(id)=> detele(`/api/user/${id}`),
    // 用户结束
    // 商品开始
    getAllgoods:(type)=> get(`/api/commodity${type ? '?tag='+type : ''}`),
    deleteGoods:(id)=> detele(`/api/commodity/${id}`),
    addgoods:(data)=> postJSON(`/api/commodity`, data),
    getgoodCommidty:(id)=> get(`/api/commodity/${id}`),
    // 商品结束
    getHomeBanners:()=> get(`/api/home`),
}
export default homeApi